<?php
session_start();
ob_start();

$sqlLang = mysql_query("select * from ".LANGUAGE." ");
?> 

<script>
function changelang(x)
{
	window.location="choosenlang.php?id="+x;
}
</script> 

<table align="left" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<TD height="4"></TD>
	</tr>
	<tr>
<?php
while($Lang_fetch = mysql_fetch_array($sqlLang))
{
	$lang_id = $Lang_fetch['langId'];
	$lang_name = $Lang_fetch['langName'];
	$lang_flag = $Lang_fetch['langFlag'];
		
// 	if($lang_flag=='' || !file_exists('../flag/'.$lang_flag))
// 		$imagepath = 'flag/noimage.jpg';
// 	else
		$imagepath ='flag/'.$lang_flag;
?>
		<td><table border="0" cellpadding="0" cellspacing="0">

        	<tr>
                <td><a href="select_language.php?lang=<?php echo $lang_name;?>" style="cursor:pointer"><img src="<?=$GLOBALS['SiteUrl'];?><?php echo $imagepath;?>" height="12" width="18" alt="<?php echo $lang_name;?>" title="<?php echo $lang_name;?>"  border="0"/></a></td>
                <td>&nbsp;</td>
            </tr>


        </table></td>
<?php
}
?>
    </tr>
</table>
